import axios from "axios";

const state = {
    movieList:[]
}
const getters = {}
const mutations = {
    CHANGE_MOVIELIST_STATE(state,{movieList}){
        state.movieList = movieList
    }
}
const actions = {
    async getMovieList({commit}){
        const res = await axios.get('https://pcw-api.iqiyi.com/search/recommend/list?channel_id=1&data_type=1&mode=11&page_id=2&ret_num=48&session=b9fd987164f6aa47fad266f57dffaa6a')
        commit('CHANGE_MOVIELIST_STATE', {movieList:res.data.data.list})
    }
}

export default {
    namespaced:true,
    state,
    getters,
    mutations,
    actions
}